Figure 16. Classes in an Application Kit Application
In the Interface layer, EOAssociation objects "observe" EODisplayGroups to make sure that the data displayed in the user interface remains consistent with enterprise object data. Display Groups interact with data sources, which supply them with enterprise objects.
A data source is a subclass of the EODataSource abstract class that presents an EODisplayGroup object with a standard interface to a store of enterprise objects. From the perspective of the EODisplayGroup to which a data source supplies enterprise objects, the actual mechanism used for storing data is of no concern; everything below the data source is effectively a "black box." The interface layer interacts with all data sources in the same way. A data source takes care of communicating with the external data store to fetch, insert, update, and delete objects.
For most database applications, data sources are instances of EODatabaseDataSource or EODetailDataSource (the data source classes supplied with the Framework). EODatabaseDataSource, defined in EOAccess, provides an interface to the Framework's access layer and ultimately, to a relational database. However, the data source can be any object that is a subclass of the abstract class EODataSource. Thus, the user interface layer can be used independently from the access layer for other types of data sources, such as an array of objects constructed by an application, or objects fetched from a flat-file database or a newsfeed.
Data sources can be arranged in master-detail configurations to support master-detail displays. For example, suppose an application displays movie studios in one table and the movies for the selected studio in another table. Selecting a new studio updates the movies table to display the movies for the newly selected studio. To support this user interface, the application has a master data source for Studio objects and a detail data source for Movie objects. Based on a relationship between Studio and Movie (a studio has many movies), the detail data source limits its Movie objects to those associated with the Studio that's selected in the application's user interface.
Most often the master data source is an EODatabaseDataSource, while the detail is an EODetailDataSource. EODetailDataSource is provided by the control layer, and is a general purpose data source for master-detail configurations.
Table of Contents
Next Section